import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpSys {
  id!: number;
  name!: string;
  logo!: unknown;
  uniacid?: number;
  isForceGetphone!: boolean;
  isPhonePlatform!: boolean;
  mainColor!: string;
  priceColor!: string;
  btn1BgColor?: string;
  btn2BgColor?: string;
  style!: number;
  isIosPay!: boolean;
  iosPayTitle?: string;
  loadingStyle: boolean = true;
  about?: unknown;
  courseTypeStyle?: boolean = true;
  marqueeColor?: string;
  marqueeSize?: number;
  marqueeOpacity?: number;
  marqueeIsCopyright?: boolean;
  marqueeCopyright?: unknown;
  afterSaleTime: number = 0;
  noPayCancelTime: number = 0;
  autoConfirmTime: number = 7;
  kdType: number = 0;
  kdnId?: unknown;
  kdnKey?: unknown;
  alyAppcode?: unknown;
  shopTypeStyle: number = 1;
  dyjType: number = 0;
  ylyZdh?: string;
  ylyMy?: string;
  ylyUserId?: string;
  ylyApikey?: string;
  loginStyle?: unknown;
}

export const ImsYzdKpSysSchema = new EntitySchema({
  class: ImsYzdKpSys,
  properties: {
    id: { primary: true, type: 'number' },
    name: { type: 'string', length: 255 },
    logo: { type: 'unknown', columnType: 'longtext' },
    uniacid: { type: 'number', nullable: true, index: 'uniacid' },
    isForceGetphone: { type: 'boolean' },
    isPhonePlatform: { type: 'boolean' },
    mainColor: { type: 'string', fieldName: 'mainColor', length: 255 },
    priceColor: { type: 'string', fieldName: 'priceColor', length: 255 },
    btn1BgColor: { type: 'string', fieldName: 'btn1BgColor', length: 255, nullable: true },
    btn2BgColor: { type: 'string', fieldName: 'btn2BgColor', length: 255, nullable: true },
    style: { type: 'number' },
    isIosPay: { type: 'boolean' },
    iosPayTitle: { type: 'string', length: 255, nullable: true },
    loadingStyle: { type: 'boolean', default: true },
    about: { type: 'unknown', columnType: 'longtext', nullable: true },
    courseTypeStyle: { type: 'boolean', nullable: true, default: true },
    marqueeColor: { type: 'string', fieldName: 'marqueeColor', length: 255, nullable: true },
    marqueeSize: { type: 'number', fieldName: 'marqueeSize', nullable: true },
    marqueeOpacity: { type: 'number', fieldName: 'marqueeOpacity', nullable: true },
    marqueeIsCopyright: { type: 'boolean', fieldName: 'marqueeIsCopyright', nullable: true },
    marqueeCopyright: {
      type: 'unknown',
      fieldName: 'marqueeCopyright',
      columnType: 'longtext',
      nullable: true,
    },
    afterSaleTime: { type: 'number', default: 0 },
    noPayCancelTime: { type: 'number', default: 0 },
    autoConfirmTime: { type: 'number', default: 7 },
    kdType: { type: 'number', default: 0 },
    kdnId: { type: 'unknown', columnType: 'longtext', nullable: true },
    kdnKey: { type: 'unknown', columnType: 'longtext', nullable: true },
    alyAppcode: { type: 'unknown', columnType: 'longtext', nullable: true },
    shopTypeStyle: { type: 'number', default: 1 },
    dyjType: { type: 'number', default: 0 },
    ylyZdh: { type: 'string', length: 255, nullable: true },
    ylyMy: { type: 'string', length: 255, nullable: true },
    ylyUserId: { type: 'string', length: 255, nullable: true },
    ylyApikey: { type: 'string', length: 255, nullable: true },
    loginStyle: { type: 'unknown', columnType: 'longtext', nullable: true },
  },
});
